#pragma once

START_NAMESPACE

	/*
		HKEY_CLASSES_ROOT
		HKEY_CURRENT_CONFIG
		HKEY_CURRENT_USER
		HKEY_LOCAL_MACHINE
		HKEY_USERS
		Windows NT/2000/XP: HKEY_PERFORMANCE_DATA 
		Windows XP: HKEY_PERFORMANCE_TEXT 
		HKEY_PERFORMANCE_NLSTEXT 
		Windows 95/98/Me: HKEY_DYN_DATA 
		
	*/

	class CRegistry
	{
	public:
		CRegistry();
		virtual ~CRegistry();

		bool Open(HKEY key,LPCSTR sub_key,bool bCreate = false);
		bool Close();

		bool Read(LPCSTR key,DWORD &value);
		bool Read(LPCSTR key,std::string &str);
		bool Read(LPCSTR key,char* pBuffer);
		bool Read(LPCSTR key,LPBYTE binary,int length);

		bool Write(LPCSTR key,DWORD value);
		bool Write(LPCSTR key,LPCSTR str);
		bool Write(LPCSTR key,LPBYTE binary,int length);

	protected:
		HKEY m_hKey;
	};

END_NAMESPACE